首先我們要建立一個Package再本地
let package = Package(
name: "MyLibrary",
platforms: [
.macOS(.v14)
],
products: [
.library(
name: "MyLibrary",
targets: ["MyLibrary"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-homomorphic-encryption", from: "1.0.0-alpha.3"),
],
targets: [
.target(
name: "MyLibrary",
dependencies: [
.product(name: "HomomorphicEncryption", package: "swift-homomorphic-encryption"),
]
),
.testTarget(
name: "MyLibraryTests",
dependencies: ["MyLibrary"]),
]
)
然後加入apple官方的同態加密的package,明天我會在實作 但是他僅支持Mac os 不支援iOS要特別注意